<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-02-21
 * Time: 9:14
 */

namespace app\admin\controller;


use app\common\controller\AdminBase;
use app\common\model\Drawingm;

class Drawing extends AdminBase
{
    public function index($u_email ='', $page = 1)
    {
        $map = [];
        if ($u_email) {
            $u_email = trim($u_email);
            $map['u_email'] = ['like', "%{$u_email}%"];
        }
        $list = Drawingm::index($map, $page);
        return $this->fetch('index', ['list' => $list, 'u_email' => $u_email]);
    }

    /**
     * 提现详情
     */
    public function detail($id)
    {
        $detail = Drawingm::detail($id);
        return $this->fetch('detail', ['detail' => $detail]);
    }

    /**
     * 修改提现状态
     */
    public function update()
    {
        $params = input();
        $did = Drawingm::updateStatus($params);
        if ($did) {
            $this->success('更新成功');
        } else {
            $this->error('更新失败');
        }
    }
}